#!/usr/bin/env bash
mkdir -p data
TEST=${1:-"0"}
[[ ${TEST} -eq 0 ]] || TEST=1

port=5000

#conda activate py37
rm -rf server/__pycache__


if [[ ${TEST} -eq 1 ]]; then
  export FLASK_APP=server
  export FLASK_ENV=development
  python -m flask run --host=0.0.0.0 --port=${port}
else
  # nohup python -m flask run --host=0.0.0.0 --port=${port} &
  # https://dormousehole.readthedocs.io/en/latest/deploying/wsgi-standalone.html#gunicorn
  # gunicorn --workers=2 test:app
  :;
fi
